package com.lxhll.personnel.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * (Department)实体类
 *
 * @author makejava
 * @since 2021-07-17 14:59:26
 */
@Data
@TableName("department")
public class Department implements Serializable {
    /**
     * 编号
     */
    @TableId
    private Integer id;
    /**
     * 名字
     */
    private String name;
    /**
     * 类型
     */
    private String type;
    /**
     * 电话
     */
    private String tel;
    /**
     * 邮箱
     */
    @Email
    private String email;
    /**
     * 部门描述
     */
    @TableField("`describe`")
    private String describe;
    /**
     * 成立日期
     */
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate createDate;
    /**
     * 修改日期
     */
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate modifyDate;

}
